/*
 * @Description: 登记 - 档案基本信息及案卷外观调查登记相关接口
 * @Author: Rfan
 * @Date: 2022-11-23 11:27:41
 * @LastEditTime: 2022-11-23 18:35:23
 */

import request from '@/utils/request';
import { Key } from 'react';
import { IPageQuery } from '@/interfaces/global';

export interface IRegBaseInfoListParams {
  archiveTypeId?: number;
  archiveTypeName?: string;
  bindingForm?: string;
  createTime?: string;
  endTime?: string;
  filePageCount?: number;
  fondsId?: number;
  fondsName?: string;
  fondsNo?: string;
  id?: number;
  isArchiveBrick?: number;
  isBindingBreakage?: number;
  isSevereContamination?: number;
  isWrapperAcidate?: number;
  isWrapperBreakage?: number;
  operator?: number;
  operatorName?: string;
  operatorTime?: string;
  registrant?: string;
  registrationTime?: string;
  remark?: string;
  startTime?: string;
}

// 分页查询移交登记列表
export function fetchRegBaseInfoListByPage(data: IPageQuery<IRegBaseInfoListParams>) {
  return request({
    url: `/register-archive-guise-check/page`,
    method: 'post',
    data
  });
}

export interface IAddRegBaseInfoParams {
  archiveTypeId: number;
  bindingForm: string;
  endTime: string;
  filePageCount: number;
  fondsId: number;
  isArchiveBrick: number;
  isBindingBreakage: number;
  isSevereContamination: number;
  isWrapperAcidate: number;
  isWrapperBreakage: number;
  registrant: string;
  registrationTime: string;
  remark: string;
  startTime: string;
}

// 添加移交登记条目
export function addRegBaseInfo(data: IAddRegBaseInfoParams) {
  return request({
    url: `/register-archive-guise-check/`,
    method: 'post',
    data
  });
}

export interface IEditRegBaseInfoParams extends IAddRegBaseInfoParams {
  id: number;
}
// 编辑移交登记条目
export function editRegBaseInfo(data: IEditRegBaseInfoParams) {
  return request({
    url: `/register-archive-guise-check/`,
    method: 'put',
    data
  });
}

// 删除移交登记条目
export function deleteRegBaseInfoItem(id: Key) {
  return request({
    url: `/register-archive-guise-check/${id}`,
    method: 'delete'
  });
}
